package cn.edu.sjtu.se.dslab.component.aadl;

import java.util.List;
/**
 * 该类对应于aadl编辑页面提交的图中的结点信息
 * @author sunke
 *
 */
public class AADLNode {
	private String id;
	private String type;
	private String name;
	private String subtype;  //device:inner/outer/else  system:main/inner
	private String isMain;
	private long db_id;
	private String parent_id;
	private boolean hasChild;
	private int x;
	private int y;
	private int width;
	private int height;
	private List<AADLFeature> features;
	private List<AADLProperty> properties;

	public AADLNode() {
		super();
		db_id = 0;
		parent_id = null;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public List<AADLProperty> getProperties() {
		return properties;
	}

	public void setProperties(List<AADLProperty> properties) {
		this.properties = properties;
	}

	public boolean isHasChild() {
		return hasChild;
	}

	public void setHasChild(boolean hasChild) {
		this.hasChild = hasChild;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getDb_id() {
		return db_id;
	}

	public void setDb_id(long db_id) {
		this.db_id = db_id;
	}

	public String getParent_id() {
		return parent_id;
	}

	public void setParent_id(String parent_id) {
		this.parent_id = parent_id;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	
	public String getSubtype() {
		return subtype;
	}

	public void setSubtype(String subtype) {
		this.subtype = subtype;
	}

	public String getIsMain() {
		return isMain;
	}

	public void setIsMain(String isMain) {
		this.isMain = isMain;
	}

	public List<AADLFeature> getFeatures() {
		return features;
	}

	public void setFeatures(List<AADLFeature> features) {
		this.features = features;
	}

	public AADLFeature getAADLFeatureByName(String _name) {
		if (features != null) {
			for (int j = 0; j < features.size(); j++) {
				if (features.get(j).getName().equals(_name)) {
					return features.get(j);
				}
			}
		}
		return null;
	}
}
